package com.starbaba.controllog.model;

import java.io.Serializable;
import java.util.Date;

public class ControlLogModelVO implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1904079420285885452L;

	private long id;
	private int operate;
	private Date time;
	private String username;
	private String bigcategory;
	private String smallcategory;
	private String biggestcategory;
	private String productname;
	private String bigcategoryid;
	private String smallcategoryid;
	private String biggestcategoryid;
	private String productid;

	public ControlLogModelVO(long id, int operate, Date date, String username,
			String bigcategory, String smallcategory, String biggestcategory, String productname,
			String bigcategoryid, String smallcategoryid,String biggestcategoryid, String productid) {
		this.id = id;
		this.operate = operate;
		this.setTime(date);
		this.username = username;
		this.bigcategory = bigcategory;
		this.smallcategory = smallcategory;
		this.biggestcategory = biggestcategory;
		this.productname = productname;
		this.bigcategoryid = bigcategoryid;
		this.smallcategoryid = smallcategoryid;
		this.biggestcategoryid = biggestcategoryid;
		this.productid = productid;
	}
	
	public ControlLogModelVO(long id) {
		this.id = id;
	}

	public ControlLogModelVO() {
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public int getOperate() {
		return operate;
	}

	public void setOperate(int operate) {
		this.operate = operate;
	}


	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getBigcategory() {
		return bigcategory;
	}

	public void setBigcategory(String bigcategory) {
		this.bigcategory = bigcategory;
	}

	public String getSmallcategory() {
		return smallcategory;
	}

	public void setSmallcategory(String smallcategory) {
		this.smallcategory = smallcategory;
	}

	public String getProductname() {
		return productname;
	}

	public void setProductname(String productname) {
		this.productname = productname;
	}

	public String getBigcategoryid() {
		return bigcategoryid;
	}

	public void setBigcategoryid(String bigcategoryid) {
		this.bigcategoryid = bigcategoryid;
	}

	public String getSmallcategoryid() {
		return smallcategoryid;
	}

	public void setSmallcategoryid(String smallcategoryid) {
		this.smallcategoryid = smallcategoryid;
	}

	public String getProductid() {
		return productid;
	}

	public void setProductid(String productid) {
		this.productid = productid;
	}

	public void copyFromModel(ControlLogModel controlLogModel) {
		this.operate = controlLogModel.getOperate();
		this.setTime(controlLogModel.getDate());
		this.username = controlLogModel.getUserName();
		ControlLogCategory bigCategoryBean = controlLogModel.getFirstCategoryVO();
		if (bigCategoryBean != null) {
			this.bigcategory = bigCategoryBean.getName();
			this.bigcategoryid = bigCategoryBean.getId();
		}
		ControlLogCategory smallCategoryBean = controlLogModel.getSecondCategoryVO();
		if (bigCategoryBean != null) {
			this.smallcategory = smallCategoryBean.getName();
			this.smallcategoryid = smallCategoryBean.getId();
		}
		ControlLogCategory biggestCategoryBean = controlLogModel.getBiggestCategoryVO();
		if (bigCategoryBean != null) {
			this.biggestcategory = biggestCategoryBean.getName();
			this.biggestcategoryid = biggestCategoryBean.getId();
		}
		ControlLogCategory productCategoryBean = controlLogModel.getProductCategoryVO();
		if (productCategoryBean != null) {
			this.productname = productCategoryBean.getName();
			this.productid = productCategoryBean.getId();
		}
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public String getBiggestcategoryid() {
		return biggestcategoryid;
	}

	public void setBiggestcategoryid(String biggestcategoryid) {
		this.biggestcategoryid = biggestcategoryid;
	}

	public String getBiggestcategory() {
		return biggestcategory;
	}

	public void setBiggestcategory(String biggestcategory) {
		this.biggestcategory = biggestcategory;
	}

}
